﻿//选择仓库
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Services_selectOutStock : ATPages
{
    Function f = new Function();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            initGvData();
        }
    }
    private void initGvData()
    {
        string maintmen = Request.QueryString["maintmen"];
        string sql = "select * from (select a.*,(select TypeName from SV_Type where a.TypeId=TypeId) as TypeName,(select catalogueName from SV_catalogue where a.ComodBarcode=ComodBarcode) as catalogueName,(select top 1 StaffName from CS_Staff where StaffId=a.maintmen ) as StaffName from SV_OutStock a ) TblOutStock where maintmen=" + maintmen + " and IsEnd<>1 order by OutStockId desc";
        //Response.Write(sql);
        //Response.End();
        ZSql dt = new ZSql();
        dt.Open(sql);
        this.GvData.DataSource = dt.m_table;
        this.GvData.DataBind();
        dt.Close();
    }
    protected void GvData_RowDataBound(object sender, GridViewRowEventArgs e)//在邦定数据
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //删除是否可用
            //string Disabled = DataBinder.Eval(e.Row.DataItem, "ProcNum").ToString();
           // if (Convert.ToInt32(Disabled) <= 0)
            //{
              //  (e.Row.Cells[0]).Enabled = false;
            //}
        }
    }
    
}
